<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="jxl.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>    
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>个人信息</title>
<link rel="stylesheet" type="text/css" href="/purpose-for-stu/css/base.css">
</head>
<body>
<%
	String stuid=request.getParameter("stuid");
	String []array;
	array = new String[5];
	int row=0;
	String stid=null;
	try
	{
		File fileName = new File("D:/workplace/stuinfo.xls");
		Workbook book = Workbook.getWorkbook(fileName);	
		Sheet sheet=book.getSheet(0); 		/*获得第一个工作表对象*/	
		int rows = sheet.getRows();			/*得到总行数*/
		for(row = 1; row<rows;row++)
		{
			Cell cell = sheet.getCell(0, row);
			String str = cell.getContents();
			
			//取得对应行的各项信息，并存入数组array中 
			if(str.equals(stuid))
			{
				stid = str;
				array[0] = str;
				Cell cell1 = sheet.getCell(1, row);
				array[1] = cell1.getContents();
				Cell cell2 = sheet.getCell(2, row);
				array[2] = cell2.getContents();
				Cell cell3 = sheet.getCell(3, row);
				array[3] = cell3.getContents();
				Cell cell4 = sheet.getCell(4, row);
				array[4] = cell4.getContents();					
			}
		}
		book.close();
	}catch(Exception e)
	{
		System.out.println(e);
	}
%>
	
	<div id="container">
		<div id="top">
			<!--Logo start -->
				<div id="logo"></div>
				<div id="info"> 
					<a href="../index.jsp">退出登录</a>
				</div>
			<!--logo end -->
		</div>
		
		<div id="content">
		  	<div id="stucontent">	
		  		<div id="stuwin">
		  		<table border="1" align="center">
				<tr><td width="120" align="center">学号：</td><td width="180"height="30" align="center"><%= array[0]%></td></tr>
				<tr><td height="30" align="center">姓名：</td><td height="20" align="center"><%= array[1]%></td></tr>
				<tr><td height="30" align="center">出生日期：</td><td height="20" align="center"><%= array[2]%></td></tr>
				<tr><td height="30" align="center">联系电话：</td><td height="20" align="center"><%= array[3]%></td></tr>
				<tr><td height="30" align="center">QQ号码：</td><td height="20" align="center"><%= array[4]%></td></tr>
				</table>
				<table align = "center" border="0">		
				<tr><td align="left" width = "75"><a href="stumodifypassword.jsp?stuid=<%= array[0]%>">修改密码</a></td>
				<td align="center" width = "90"><a href="stumodifyinfo.jsp?stuid=<%= array[0]%>">修改个人信息</a></td>
				<td align="right" width = "130"><a href="stuinfoall.jsp?stuid=<%= array[0]%>">查看班级成员信息</a></td></tr>
				
				</table>
				</div>
			</div>
		</div>
		<div id="footer">@copyright</div>
	</div>


</body>
</html>